<template>
  <!-- 中西医诊断对照表 -->
  <div>
    <h1>中医病症与西医疾病对照统计报表（二）</h1>
    <h3>时期: {{startDate}} ～ {{endDate}}</h3>
    <h2>
      <span>医院名称：桃源县中医院</span>
      <span>科 别：{{label}}</span>
      <span></span>
    </h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="xh" label="序号" align="center" width></el-table-column>
      <el-table-column prop="zydm" label="中医病名编码" align="center" width></el-table-column>
      <el-table-column prop="zymc" label="中医疾病名称" align="center" width></el-table-column>
      <el-table-column prop="zhdm" label="中医证候编码" align="center" width></el-table-column>
      <el-table-column prop="zhMC" label="中医证候名称" align="center" width></el-table-column>
      <el-table-column prop="icd" label="ICD类目" align="center" width></el-table-column>
      <el-table-column prop="xymc" label="西医疾病名称" align="center" width></el-table-column>
      <el-table-column prop="f1" label="构成比(%)" align="center" width></el-table-column>
      <el-table-column prop="f2" label="出院人数" align="center" width></el-table-column>
      <el-table-column label="出院病人数(人)" align="center" width>
        <el-table-column prop label="合计" align="center" width></el-table-column>
        <el-table-column prop="f4" label="治愈" align="center" width></el-table-column>
        <el-table-column prop="f5" label="好转" align="center" width></el-table-column>
        <el-table-column prop="f6" label="未愈" align="center" width></el-table-column>
        <el-table-column prop="f7" label="死亡" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="f8" label="出院病人占用总床日数" align="center" width></el-table-column>
      <el-table-column prop="f9" label="中医治疗例数" align="center" width></el-table-column>
      <el-table-column prop="f10" label="出院者总费用" align="center" width></el-table-column>
      <el-table-column prop="f11" label="辨识与出院诊断符合人数" align="center" width></el-table-column>
      <el-table-column prop="f12" label="入院与出诊断符合人数" align="center" width></el-table-column>
      <el-table-column prop="f13" label="入院三日内诊断符合人数" align="center" width></el-table-column>
      <el-table-column prop="f14" label="无菌手术例数" align="center" width></el-table-column>
      <el-table-column prop="f15" label="无菌手术切口甲级愈合例数" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { tcmWesternContrast } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: "",
      label: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        tcmWesternContrast({
          bz: this.dateList.administrative,
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.label = this.dateList.officeLable;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>